<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>全部处罚记录</title>
    <link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
</head>
<body style="background-color: transparent;">
<div class="container" >
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1><small>
                    全部处罚记录
                </small></h1>
            </div>
        </div>
        <div class="row">
            <div class="col-md-4 col-md-offset-1 column">

                <a class="btn btn-primary" href="${pageContext.request.contextPath}/record/allRecordC">显示全部处罚记录</a>
            </div>

            <div class="col-md-3 column">
                <form action="${pageContext.request.contextPath}/record/queryRecordByClass" method="post" style="float: left;" class="form-inline">
                    <span style="color: red;font-weight: bold">${error}</span>
                    <input type="text" name="getRecordByClass" class="form-control" placeholder="请选择查询类型,0个人或1组织"/>
                    <input type="submit" value="查询" class="btn btn-primary"/>
                </form>
            </div>
            <div class="col-md-4 column">
                <%--查询--%>
                <form action="${pageContext.request.contextPath}/record/queryRecordByName" method="post" style="float: left;" class="form-inline">
                    <input type="text" name="getRecordByName" class="form-control" placeholder="请输入名字或者单位名称">
                    <input type="submit" value="查询" class="btn btn-primary">
                </form>

            </div>
        </div>
    </div>

    <div class="row clearfix">
        <div class="col-md-10 col-md-offset-1 column">
            <table class="table table-hover table-striped">
                <thead>
                </thead>
                <tbody>
                <%-- 从数据库查询--%>
                <c:forEach var="record" items="${list}">
                    <tr>
                        <td>${record.p_case}</td>
                        <td>
                            <a class="btn btn-info" href="${pageContext.request.contextPath}/record/toUpdate?id=${record.p_id}">修改</a>
                            &nbsp; | &nbsp;
                            <a class="btn btn-danger"  href="javascript:void(0)" onclick="sc(${record.p_id})">删除</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
</div>

<script type="text/javascript">

    function sc(id) {
       if(window.confirm("确认删除吗")){
           document.location="${pageContext.request.contextPath}/record/delRecord?p_id="+id
       }
    }
</script>
</body>
</html>
